package cn.jofei.common.monitor.cmds;

/**
 * @author bao
 * @version project-manager v1.0
 * @description 无参数的 cmd 命令
 * @date 2021/12/27 13:32
 */
public interface Shells {
    /**
     * 获取本机IP
     */
    String SH_GET_IP = "ip addr | awk '/^[0-9]+: / {}; /inet.*168.10.*global/ {print gensub(/(.*)\\/(.*)/, \"\\\\1\", \"g\", $2)}'";
    /**
     * 获取总内存 KB
     */
    String SH_RAM_TOTAL = "free | grep 'Mem:' |awk '{print $2}'";
    /**
     * 磁盘空间
     */
    String SH_DISK_PER = "df -h|grep /dev |awk '{print $5$6}'";
    /**
     * 获取已使用内存 KB
     */
    String SH_RAM_USED = "free | grep 'Mem:' | awk '{print $3}'";
    /**
     * 获取cpu空闲
     */
    String SH_CPU_FREE = "cat /proc/stat | grep 'cpu' |head -1| awk '{print $2+$3+$4+$5+$6+$7+$8}'";
    /**
     * 获取cpu总算量
     */
    String SH_CPU_TOTAL = "cat /proc/stat | grep 'cpu' |head -1| awk '{print $5}'";
}
